package de.backtomedieval.units;

import de.backtomedieval.R;
import de.backtomedieval.game.Costs;
import de.backtomedieval.main.Game;
import de.backtomedieval.research.Technology;

public class Catapult extends AbstractUnit {
	//*******************************************
	private static final int _healthpoints = 200;
	private static final int _attackMultiple = 3;
	private static final int _attack = 150;
	private static final int _defense = 2;
	private static final int _attackquality = 40;
	private static final int[] _attackRounds = {2,3,4,5,6};
	private static Costs costSetting = null;	
	private static final int _buildPoints = 300;	
	//*******************************************

	public Catapult(Technology technology) {
		super(_healthpoints, _attack, _defense, _attackquality, _attackMultiple, _attackRounds, _buildPoints);
		if (technology != null) this.setAttack(_attack + technology.getCatapultAttackBonus());
		if (technology != null) this.setDefense(_defense + technology.getCatapultDefenseBonus());
		if (costSetting == null){
			costSetting = new Costs();
			costSetting.setLumberCost(200);
			costSetting.setIronCost(100);
			costSetting.setGoldCost(40);
			costSetting.setStoneCost(50);
			}
		this.setCosts(costSetting);
	}
	
	@Override
	public String getName(int count) {
		if (count==1) return Game.getString(R.string.unit_catapult);
		return Game.getString(R.string.unit_catapult_pl);
	}
	
	@Override
	public Integer getImage() {
		return R.drawable.catapult;
	}
	
	@Override
	public int getBuildIn() {
		return AbstractUnit.BUILD_IN_MANUFRACTURE;
	}
	
	public static int getBaseAttack() {
		return _attack;
	}
	
	public static int getBaseDefense() {
		return _defense;
	}
	
}
